import request from '@/utils/request'
import qs from 'qs'
export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  var new_data = qs.stringify(data)

  return request({
    url: '/sys/login',
    method: 'post',
    data: new_data
  })
}

export function logout() {
  return request({
    url: '/sys/logout',
    method: 'post'
  })
}

export function getUserInfo() {
  console.log('innner getuserinfo')
  return request({
    url: '/sys/user/info',
    method: 'get'
  })
}

export function getUserInfo_t() {
  console.log('getUserIfo______________t')
  return request({
    url: '/sys/user/info',
    method: 'post'
  })
}

export function getRouter() {
  return request({
    url: '/sys/menu/nav',
    method: 'get'
  })
}
